package github.remonlong.restfulutil.exception;

import github.remonlong.restfulutil.exception.api.BadApiException;
import github.remonlong.restfulutil.exception.enumeration.EnumResult;

/**
 * 全局异常处理类
 */
public class ExceptionHandle {

    /**
     * restful 接口异常处理
     *
     * @param e @link { BadApiException }
     * @return @Link { Result }
     */
    public Result<String> bindRestfulException(BadApiException e) {
        BadApiException badApiException = (BadApiException) e;
        return RestfulResultUtil.error(badApiException.getResult());
    }
}